package com.hippo.provider.controller.websocket;

import com.hippo.core.pojo.entity.SysNotice;
import com.hippo.core.pojo.vo.result.BaseResult;
import com.hippo.database.mapper.SysNoticeMapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @ClassName WebSocketController
 * @Description TODO websocket相关接口
 * @Author tangxl
 * @create 2023-04-28 09:50
 **/
@RestController
@RequestMapping("/webSocket")
@Tag(name = "websocket相关接口")
public class WebSocketController {

    @Autowired
    private SysNoticeMapper sysNoticeMapper;

    @Operation(summary = "获取系统通知")
    @GetMapping("/getSysNotice")
    public BaseResult getSysNotice(){
        List<SysNotice> sysNoticeList = sysNoticeMapper.selectSysNoticeByCutOffTime(LocalDateTime.now());
        return BaseResult.ok(sysNoticeList);
    }
}
